package com.ruoyi.common.exception.api;

import org.springframework.http.HttpStatus;

/**
 * 描述：
 *
 * @author 史彦磊
 * @Date 2019-12-25 21:47
 */
public class FaultException extends RuntimeException {


    protected int code;
    protected String message;
    protected HttpStatus httpStatus;


    public FaultException(Throwable cause){
        super(cause);
    }

    public FaultException(int code, String message){
        this.code = code;
        this.message = message;
        this.httpStatus = HttpStatus.OK;
    }

    public FaultException(int code, String message, HttpStatus status) {
        this.code = code;
        this.message = message;
        this.httpStatus = status;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public HttpStatus getHttpStatus() {
        return httpStatus;
    }

    public void setHttpStatus(HttpStatus httpStatus) {
        this.httpStatus = httpStatus;
    }
}
